<template>
  <div style="position:fixed; bottom:0">
    <van-tabbar v-model="active">
      <van-tabbar-item icon="shop" @click="click(0)" to="/">首页</van-tabbar-item>
      <van-tabbar-item icon="chat" @click="click(1)" to="/Category">分类</van-tabbar-item>
      <van-tabbar-item icon="chat" @click="click(2)" to="/Cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="records" @click="click(3)" to="/Person">个人</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
  import appFunc from "../../assets/app/func"

  export default {
    data: function () {
      return {
        active: appFunc.getActiveNav()
      }
    },
    methods: {
      click: function (id) {
        appFunc.setActiveNav(id)
      }
    }
  }
</script>
